<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2024/4/19
  Time: 18:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <c:set var="pretax" value="${param.pretax}" scope="session"></c:set>
    <c:set var="fsi" value="${param.fsi}" scope="session"></c:set>
    <c:set var="tea" value="${param.tea}" scope="session"></c:set>
    <c:set var="amount" value="${pretax-fsi-tea}"></c:set>
    <c:choose>

        <c:when test="${amount<=1500}">
            <c:set var="tax" value="${amount*3/100-0}" scope="session"/>
        </c:when>

        <c:when test="${amount>1500&&amount<=4500}">
            <c:set var="tax" value="${amount*10/100-105}" scope="session"/>
        </c:when>

        <c:when test="${amount>4500&&amount<=9000}">
            <c:set var="tax" value="${amount*20/100-555}" scope="session"/>
        </c:when>

        <c:when test="${amount>9000&&amount<=35000}">
            <c:set var="tax" value="${amount*25/100-1005}" scope="session"/>
        </c:when>

        <c:when test="${amount>35000&&amount<=55000}">
            <c:set var="tax" value="${amount*30/100-2755}" scope="session"/>
        </c:when>

        <c:when test="${amount>55000&&amount<=80000}">
            <c:set var="tax" value="${amount*35/100-5505}" scope="session"/>
        </c:when>

        <c:when test="${amount>80000}">
            <c:set var="tax" value="${amount*45/100-13505}" scope="session"/>
        </c:when>

    </c:choose>
    <c:set var="aftertax" value="${pretax-fsi-tax}" scope="session"/>
    <c:redirect url="tax.jsp"></c:redirect>
</head>
<body>

</body>
</html>
